<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTagsTable extends Migration
{
    protected $tableName = 'tags';

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create($this->tableName, function (Blueprint $table) {
            $table->increments('id');
            $table->string('cn_name')->comment('中文名称');
            $table->string('en_name')->comment('英文名称');
            $table->integer('cover')->comment('封面图片');
            $table->integer('audio')->comment('英文音频');
            $table->string('description')->comment('模板描述');
            $table->timestamps();

            $table->softDeletes();
        });
        DB::statement("ALTER TABLE `$this->tableName` comment '知识点标签表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists($this->tableName);
    }
}
